home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
G-Games
/
(c)gf.d64
/
super mind.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
8KB
|
282 lines
4 PRINT"[147]":POKE53281,11:POKE53280,13
5 INPUT"DO YOU WANT COLOUR?(Y/N)";V$
7 IF V$="Y" THEN 10
8 IF V$="N" THEN 5000
9 PRINT"Y[146] OR N[146]!!!":GOTO 6
10 POKE 53281,0:POKE 53280,0:PRINT"[147][159]MASTERMIND"
20 PRINT"[156]COLOUR VERSION"
30 PRINT"BY [158]NIKI [129]TIMAR"
35 GOSUB 1300
40 PRINT"HIT ANY KEY TO CONTINUE[146]"
50 GET S$:IFS$=""THEN GOSUB1320:GOTO50
60 K=INT(8*RND(1))+3
70 POKE 53281,00:POKE 53280,K
80 PRINT"[147]"
90 PRINT" [129]***[159]*[156]**[154]M[158]A[129]S[149]T[150]E[159]R[152]M[153]I[154]N[155]D[146][129]***[159]*[156]**"
100 PRINT" *[158]*[129]C[149]O[150]L[151]O[152]U[153]R [154]V[155]E[129]RSI[159]O[156]N[146]**"
110 PRINT""
120 PRINT" [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
130 PRINT" [212] MASTERMIND[146] [217]"
140 PRINT" [212] ???????? [146] [217]"
150 PRINT" [212] .. [213][201][213][201][213][201][213][201] [217]"
160 PRINT" [212]8.. [202][203][202][203][202][203][202][203] [217]"
170 PRINT" [164] [212] .. [213][201][213][201][213][201][213][201][160][217]"
180 PRINT" 1=[204][165] [212]7.. [202][203][202][203][202][203][202][203] [217]"
190 PRINT" 2= [146] [212] .. [213][201][213][201][213][201][213][201][160][217]"
200 PRINT" 3= [146] [212]6.. [202][203][202][203][202][203][202][203] [217] [209]=CORRECT"
210 PRINT"[160]4=[159] [146][160][160][160][160][160][212] ..[160][160][213][201][213][201][213][201][213][201][160][217] COLOUR"
220 PRINT" 5=[156] [146] [212]5.. [202][203][202][203][202][203][202][203] [217] BUT IN"
230 PRINT" 6= [146] [212] .. [213][201][213][201][213][201][213][201][160][217] WRONG"
240 PRINT" 7= [146] [212]4.. [202][203][202][203][202][203][202][203] [217] POSITION"
250 PRINT" 8=[158] [146] [212] .. [213][201][213][201][213][201][213][201][160][217]"
260 PRINT" [212]3.. [202][203][202][203][202][203][202][203] [217] [215]=CORRECT"
270 PRINT" [212] .. [213][201][213][201][213][201][213][201][160][217] COLOUR"
280 PRINT" [212]2.. [202][203][202][203][202][203][202][203] [217] IN CORRECT"
290 PRINT" [212] .. [213][201][213][201][213][201][213][201][160][217] POSITION"
300 PRINT" [212]1.. [202][203][202][203][202][203][202][203] [217]"
310 PRINT" [212] [217]"
320 PRINT" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]";
330 PRINT"HOW MANY"
340 PRINT"COLOURS"
350 PRINT"DO YOU"
360 PRINT"WANT(1-8)?";
370 GET L$:IF L$="" THEN 370
380 IF ASC(L$)<49ORASC(L$)>48+8THEN 370
390 PRINTL$
400 L=VAL(L$)
410 D(1)=INT(L*RND(TI))+1:C(1)=D(1)
420 D(2)=INT(L*RND(TI))+1:C(2)=D(2)
430 D(3)=INT(L*RND(TI))+1:C(3)=D(3)
440 D(4)=INT(L*RND(TI))+1:C(4)=D(4)
450 PRINT"WHAT ARE"
460 PRINT"YOUR"
470 PRINT"GUESSES?"
480 FOR X=1 TO 8
490 FOR J=1 TO 4:C(J)=D(J):NEXTJ
500 FOR K=1TO4
510 DE=1
520 J=K
530 GET B$(J)
540 IF B$(J)=""THEN530
550 IF B$(J)=CHR$(20)AND J>1 THEN DR=1:J=J-1:GOTO 590
560 IF ASC(B$(J))<49 OR ASC(B$(J))>48+L THEN 530
570 REM PRINTB$(J)
580 B(J)=VAL(B$(J))
590 ON X GOSUB 880,900,920,940,960,980,1000,1020
600 IF DR=1 THEN DR=0:DS=DS+1:GOTO 530
610 IF DS>0 THEN J=J+1:DS=DS-1:GOTO530
620 IF DE=0 ANDDS=0 THEN DE=DE+1:GOTO650
630 NEXT K
640 J=5
650 GETA$:IFA$=""THEN650
660 IF A$=CHR$(20)THENDR=1:DS=-1:J=J-1:DE=0:GOTO590
670 IFA$=CHR$(13)THEN680
680 M=0:N=0
690 FOR I=1 TO 4
700 IF C(I)=B(I) THEN M=M+1:C(I)=0:B(I)=20
710 NEXT I
720 Y=T-10
730 IF M=4 THEN 1110
740 FOR S=1 TO 4
750 FOR V=1 TO 4
760 IF B(S)=C(V) THEN N=N+1:B(S)=20:C(V)=0
770 NEXT V:NEXT S
780 Y=T-10
790 IF M=1 THEN POKE Y,87
800 IF M=2 THEN POKE Y,87:POKE Y+1,87
810 IF M=3 THEN POKE Y,87:POKE Y+1,87:POKE Y+41,87
820 IF N=1 THEN POKE Y+40,81
830 IFN=2THEN POKE Y+40,81:POKE Y+41,81
840 IF N=3 THEN POKE Y+40,81:POKE Y+41,81:POKE Y+1,81
850 IF N=4 THEN POKE Y+40,81:POKE Y+41,81:POKE Y+1,81:POKE Y,81
860 NEXT X
870 GOTO 1140
880 T=1877
890 GOTO 1040
900 T=1797
910 GOTO 1040
920 T=1717
930 GOTO 1040
940 T=1637
950 GOTO 1040
960 T=1557
970 GOTO 1040
980 T=1477
990 GOTO 1040
1000 T=1397
1010 GOTO 1040
1020 T=1317
1030 GOTO 1040
1040 T=T+2*J:T1=T+54272
1050 IF DR=1 THEN POKET1,1:POKET1+1,1:POKET1+40,1:POKET1+41,1
1060 IFDR=1 THEN POKET,85:POKET+1,73:POKET+40,74:POKET+41,75:RETURN
1070 POKE T,108:POKE T+1,123:POKE T+40,124:POKE T+41,126
1080 IFB(J)=1THENPOKET,112:POKET+1,110:POKET+40,109:POKET+41,125:GOTO 1100
1090 POKE T1,B(J)-1:POKE T1+1,B(J)-1:POKE T1+40,B(J)-1:POKE T1+41,B(J)-1
1100 RETURN
1110 IF M=4 THEN POKE Y,87:POKE Y+1,87:POKE Y+41,87:POKE Y+40,87
1120 IF X=1 THEN PRINT"PERFECT IN 1 TRY!!DID YOU CHEAT?!?":GOTO 1140
1130 PRINT"PERFECT IN";X;"TRIES!!!"
1140 FOR J=1 TO 4:B(J)=D(J)
1150 T=1235
1160 GOSUB 1040
1170 NEXT J
1180 PRINT"DO YOU"
1190 PRINT"WANT TO"
1200 PRINT"PLAY"
1210 INPUT"AGAIN";R$
1220 IF LEFT$(R$,1)="Y" THEN 60
1230 PRINT"[147]"
1240 END
1250 REM
1260 REM ********************
1270 REM ****** TITLE BORDER ******
1280 REM ********************
1290 REM
1300 BX=4:BY=3:BW=7:BV=6
1320 FOR BI=1 TO 40 STEP4
1330 POKE1023+BI,81:POKE55295+BI,BX:POKE1024+BI,81:POKE55296+BI,BY
1340 POKE 1025+BI,81:POKE 55297+BI,BW:POKE 1026+BI,81:POKE 55298+BI,BV
1350 POKE2024-BI,81:POKE56296-BI,BX:POKE2023-BI,81:POKE56295-BI,BY
1360 POKE 2022-BI,81:POKE 56294-BI,BW:POKE2021-BI,81:POKE 56293-BI,BV
1370 NEXTBI
1380 FOR BI=1TO23 STEP 4
1390 POKE1984-40*BI,81:POKE56256-40*BI,BX:POKE1984-40*(BI+1),81:POKE56256-40*(BI+1),BY
1400 POKE1984-40*(BI+2),81:POKE56256-40*(BI+2),BW
1410 POKE1984-40*(BI+3),81:POKE56256-40*(BI+3),BV
1420 POKE1063+40*BI,81:POKE55335+40*BI,BX:POKE1063+40*(BI+1),81:POKE55335+40*(BI+1),BY
1430 POKE1063+40*(BI+2),81:POKE55335+40*(BI+2),BW
1440 POKE1063+40*(BI+3),81:POKE55335+40*(BI+3),BV
1450 NEXTBI
1460 BZ=BX:BX=BY:BY=BW:BW=BV:BV=BZ:RETURN
4000 REM
4010 REM**************************
4020 REM**** MASTERMIND ****
4030 REM**************************
4040 REM
5000 PRINT"[147]MASTERMIND[146]"
5010 PRINT"BY NIKI TIMAR"
5020 GOSUB 1300
5030 PRINT"HIT ANY KEY TO CONTINUE[146]"
5050 GET S$:IFS$=""THEN GOSUB1320:GOTO5050
5080 PRINT"[147]"
5085 PRINT" "
5090 PRINT" ******MASTERMIND[146]******"
5110 PRINT""
5120 PRINT" [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
5130 PRINT" [212] ?MASTERMIND?[146] [217]"
5140 PRINT" [212] ???????? [146] [217]"
5150 PRINT" [212] .. [213][201][213][201][213][201][213][201] [217]"
5160 PRINT" [212]8.. [202][203][202][203][202][203][202][203] [217]"
5170 PRINT" [212] .. [213][201][213][201][213][201][213][201][160][217]"
5180 PRINT" [212]7.. [202][203][202][203][202][203][202][203] [217]"
5190 PRINT" [212] .. [213][201][213][201][213][201][213][201][160][217]"
5200 PRINT" [212]6.. [202][203][202][203][202][203][202][203] [217] [209]=CORRECT"
5210 PRINT"[160] [160][212] ..[160][160][213][201][213][201][213][201][213][201][160][217] NUMBER"
5220 PRINT" [212]5.. [202][203][202][203][202][203][202][203] [217] BUT IN"
5230 PRINT" [212] .. [213][201][213][201][213][201][213][201][160][217] WRONG"
5240 PRINT" [212]4.. [202][203][202][203][202][203][202][203] [217] POSITION"
5250 PRINT" [212] .. [213][201][213][201][213][201][213][201][160][217]"
5260 PRINT" [212]3.. [202][203][202][203][202][203][202][203] [217] [215]=CORRECT"
5270 PRINT" [212] .. [213][201][213][201][213][201][213][201][160][217] NUMBER"
5280 PRINT" [212]2.. [202][203][202][203][202][203][202][203] [217] IN CORRECT"
5290 PRINT" [212] .. [213][201][213][201][213][201][213][201][160][217] POSITION"
5300 PRINT" [212]1.. [202][203][202][203][202][203][202][203] [217]"
5310 PRINT" [212] [217]"
5320 PRINT" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]";
5330 PRINT"HOW MANY"
5340 PRINT"NUMBERS"
5350 PRINT"DO YOU"
5360 PRINT"WANT(1-8)?";
5370 GET L$:IF L$="" THEN 5370
5380 IF ASC(L$)<49ORASC(L$)>48+8THEN 5370
5390 PRINTL$
5400 L=VAL(L$)
5410 D(1)=INT(L*RND(TI))+1:C(1)=D(1)
5420 D(2)=INT(L*RND(TI))+1:C(2)=D(2)
5430 D(3)=INT(L*RND(TI))+1:C(3)=D(3)
5440 D(4)=INT(L*RND(TI))+1:C(4)=D(4)
5450 PRINT"WHAT ARE"
5460 PRINT"YOUR"
5470 PRINT"GUESSES?"
5480 FOR X=1 TO 8
5490 FOR J=1 TO 4:C(J)=D(J):NEXTJ
5500 FOR K=1TO4
5510 DE=1
5520 J=K
5530 GET B$(J)
5540 IF B$(J)=""THEN5530
5550 IF B$(J)=CHR$(20)AND J>1 THEN DR=1:J=J-1:GOTO 5590
5560 IF ASC(B$(J))<49 OR ASC(B$(J))>48+L THEN 5530
5570 REM PRINTB$(J)
5580 B(J)=VAL(B$(J))
5590 ON X GOSUB 5880,5900,5920,5940,5960,5980,6000,6020
5600 IF DR=1 THEN DR=0:DS=DS+1:GOTO 5530
5610 IF DS>0 THEN J=J+1:DS=DS-1:GOTO5530
5620 IF DE=0 ANDDS=0 THEN DE=DE+1:GOTO5650
5630 NEXT K
5640 J=5
5650 GETA$:IFA$=""THEN5650
5660 IF A$=CHR$(20)THENDR=1:DS=-1:J=J-1:DE=0:GOTO5590
5670 IFA$=CHR$(13)THEN5680
5680 M=0:N=0
5690 FOR I=1 TO 4
5700 IF C(I)=B(I) THEN M=M+1:C(I)=0:B(I)=20
5710 NEXT I
5720 Y=T-10
5730 IF M=4 THEN 6110
5740 FOR S=1 TO 4
5750 FOR V=1 TO 4
5760 IF B(S)=C(V) THEN N=N+1:B(S)=20:C(V)=0
5770 NEXT V:NEXT S
5780 Y=T-10
5790 IF M=1 THEN POKE Y,87
5800 IF M=2 THEN POKE Y,87:POKE Y+1,87
5810 IF M=3 THEN POKE Y,87:POKE Y+1,87:POKE Y+41,87
5820 IF N=1 THEN POKE Y+40,81
5830 IFN=2THEN POKE Y+40,81:POKE Y+41,81
5840 IF N=3 THEN POKE Y+40,81:POKE Y+41,81:POKE Y+1,81
5850 IF N=4 THEN POKE Y+40,81:POKE Y+41,81:POKE Y+1,81:POKE Y,81
5860 NEXT X
5870 GOTO 6140
5880 T=1877
5890 GOTO 6040
5900 T=1797
5910 GOTO 6040
5920 T=1717
5930 GOTO 6040
5940 T=1637
5950 GOTO 6040
5960 T=1557
5970 GOTO 6040
5980 T=1477
5990 GOTO 6040
6000 T=1397
6010 GOTO 6040
6020 T=1317
6030 GOTO 6040
6040 T=T+2*J:T1=T+54272
6050 IF DR=1 THEN POKET1,1:POKET1+1,1:POKET1+40,1:POKET1+41,1
6060 IFDR=1 THEN POKET,85:POKET+1,73:POKET+40,74:POKET+41,75:RETURN
6070 POKE T,160:POKE T+1,160:POKE T+40,160
6080 POKE T1,11:POKE T1+1,11:POKE T1+40,11
6090 POKE T+41,B(J)+48:POKET1+41,1
6100 RETURN
6110 IF M=4 THEN POKE Y,87:POKE Y+1,87:POKE Y+41,87:POKE Y+40,87
6120 IF X=1 THEN PRINT"PERFECT IN 1 TRY!!DID YOU CHEAT?!?":GOTO 6140
6130 PRINT"PERFECT IN";X;"TRIES!!!"
6140 FOR J=1 TO 4:B(J)=D(J)
6150 T=1237
6160 GOSUB 6040
6165 POKET+40,160:POKET1+40,11
6170 NEXT J
6175 POKET+32,160:POKET1+32,11:POKET1+33,11:POKET1+31,11
6177 FORU=7TO10:POKET-U,160:POKET1-U,11:NEXT
6180 PRINT"DO YOU"
6190 PRINT"WANT TO"
6200 PRINT"PLAY"
6210 INPUT"AGAIN";R$
6220 IF LEFT$(R$,1)="Y" THEN 5080
6230 PRINT"[147]"
6240 END